home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 2 / CU Amiga Magazine's Super CD-ROM 02 (1996)(EMAP Images)(GB)[!][issue 1996-04].iso / magazine / amiga_e / epp / docs / pmodules / breadstr.doc next >
Text File  |  1980-01-05  |  1KB  |  27 lines

  1. bReadString.e - Buffered read-string.  This is about 100 million
  2. times faster than ReadStr(), or the pmodule readStr(), but it
  3. exacts its toll in complexity of use.
  4.  
  5.  
  6. OBJECT DESCRIPTION:
  7. ~~~~~~~~~~~~~~~~~~~
  8. OBJECT readDataType       /* You need one of these for each file. */
  9.   fh : LONG               /* := handle of file you have opened    */
  10.   bufSize : LONG          /* := inputBuffer size                  */
  11.   maxLineLength : LONG    /* := StrMax() (may be dynamic to read  */
  12.                           /*    in strings of different length.)  */
  13.   inputBuffer : LONG      /* create this with New()               */
  14.   length : LONG           /* num bytes read into inputBuffer      */
  15.   pos : LONG              /* next available char in inputBuffer   */
  16. ENDOBJECT
  17.  
  18.  
  19. PROTOCOL FOR USE:
  20. ~~~~~~~~~~~~~~~~~
  21. 1. Create object, e.g.:  DEF rd:readDataType
  22. 2. Open file with Open() and store filehandle in rd.fh
  23. 3. Allocate an estring of any length and assign the address to rd.inputBuffer
  24. 4. Assign the length of the buffer created in step 3 to rd.maxLineLength
  25. 5. Call bReadStr(), numbytes in rd.inputBuffer is returned.
  26.  
  27.